home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
dbmail.arc
/
ML0453.PRG
< prev
next >
Wrap
Text File
|
1988-06-18
|
4KB
|
199 lines
NOTE ML0453 - ROUTINE TO DELETE USING INPUT BOOLEAN 9/24/84
SET TALK OFF
ERASE
STORE 0 TO ZIPLO
STORE 99999 TO ZIPHI
STORE '.AND.OR. .NOT.' TO LC
STORE ".' " TO DELM
@ 7,10 SAY ' DELETE Selected Records by Logical (BOOLEAN) Criteria'
@ 9,10 SAY 'Input ZIP CODE Range ' GET ZIPLO PICTURE '99999'
@ 9,41 SAY ' TO ' GET ZIPHI PICTURE '99999'
READ
CLEAR GETS
STORE ' ' TO INSTR
STORE F TO OK
DO WHILE .NOT. OK
@ 14,0 SAY 'Input BOOLEAN criteria ' GET INSTR PICTURE 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
READ
CLEAR GETS
@ 15,0
@ 17,0
@ 17,10 say 'Scanning BOOLEAN Criteria for Errors. Please Wait.'
@ 19,0
STORE TRIM(INSTR) TO WS
STORE 1 TO N
STORE LEN(WS)+1 TO M
STORE WS+' ' TO WS
STORE 0 TO LO,PLOC,ECNT
STORE ' ' TO EC
STORE T TO FRST
STORE F TO NT,PLO
DO WHILE N<M
DO WHILE @( $(WS,N,1) ,DELM)>2 .AND.N<M
STORE N+1 TO N
ENDDO
STORE @( $(WS,N,1) ,DELM) TO P
STORE N+1 TO L
DO CASE
CASE N<M .AND. P=1
DO WHILE @( $(WS,L,1), DELM)#1 .AND.L<M
STORE L+1 TO L
ENDDO
IF L=M
STORE '1' TO EC
ELSE
STORE @( !($(WS,N,L-N+1)), LC) TO LO
DO CASE
CASE LO=10
IF PLO .OR. .NOT. NT
STORE PLOC TO LO
STORE T TO NT
ELSE
IF NT
STORE '2' TO EC
ELSE
STORE '3' TO EC
ENDIF
ENDIF
CASE LO=1 .OR. LO=5
IF PLO .OR. NT
IF NT
STORE '5' TO EC
ELSE
STORE '4' TO EC
ENDIF
ELSE
STORE T TO PLO
STORE LO TO PLOC
note logical operator flag set to 1 or 5. No more processing needed
ENDIF
OTHERWISE
STORE '6' TO EC
ENDCASE
ENDIF {n=m}
CASE N<M .AND. P=2
DO WHILE @( $(WS,L,1), DELM)#P .AND. L<M
STORE L+1 TO L
ENDDO
IF L=M
STORE '7' TO EC
ELSE
note following dbase practice, anything between delimiters is allowed
IF L-N=1
STORE 'B' TO EC
ELSE
STORE "@('"+$(WS,N+1,L-N-1)+"',CODES)" TO WA
DO CASE
CASE FRST.AND. LO=0
NOTE don't need to add logical operator in front of criteria
IF NT
STORE WA+'=0' TO WA
ELSE
STORE WA+'>0' TO WA
ENDIF
CASE FRST.AND. LO>0
STORE '8' TO EC
CASE .NOT.FRST.AND. LO=0
STORE '9' TO EC
CASE .NOT.FRST.AND. LO>0
STORE $(LC,LO,5)+WA TO WA
IF NT
STORE WA+'=0' TO WA
ELSE
STORE WA+'>0' TO WA
ENDIF
OTHERWISE
STORE 'A' TO EC
ENDCASE
IF FRST
STORE WA TO OS
STORE F TO FRST
ELSE
STORE OS+WA TO OS
ENDIF
ENDIF {l-n=1}
STORE 0 TO LO,PLOC
STORE F TO NT,PLO
ENDIF {l=m}
OTHERWISE
DO WHILE @( $(WS,L,1), DELM)=0 .AND. L<M
STORE L+1 TO L
ENDDO
STORE 'C' TO EC
STORE L-1 TO L
ENDCASE
IF EC#' '
STORE ECNT+1 TO ECNT
STORE STR(ECNT,1+INT(ECNT/10) ) TO EP
STORE EC TO EC&EP
STORE N TO BE&EP
STORE L TO EE&EP
STORE ' ' TO EC
STORE 0 TO LO,PLOC
STORE F TO NT,PLO
ENDIF
STORE L+1 TO N
ENDDO {n<m}
IF ECNT>0
STORE 0 TO P
@ 15,10 SAY 'ERROR CODES:'
@ 17,2 SAY ECNT USING '99'
@ 17,5 SAY 'Errors found. Error codes appear underneath the string in error.'
DO WHILE P<ECNT
STORE P+1 TO P
STORE STR(P, 1+INT(P/10) ) TO EP
STORE BE&EP TO N
STORE EE&EP+1 TO M
DO WHILE N<M
@ 15,23+N SAY EC&EP USING 'X'
STORE N+1 TO N
ENDDO
ENDDO
STORE 'Y' TO EC
@ 19,10 SAY 'Correct and Retry? (Y/N) ' GET EC PICTURE '!'
READ
STORE EC#'Y' TO OK
ELSE
STORE T TO OK
ENDIF
ENDDO OK
IF ECNT=0
STORE '('+OS+')' TO OS
STORE 'Y' TO SEL
@ 17,10 SAY 'No Errors Found. Are you Sure you Wish to Continue? (Y/N) ' GET SEL PICTURE '!'
READ
IF SEL='Y'
SET TALK ON
DELETE ALL FOR &OS .AND. (VAL(ZIP)>=ZIPLO .AND. VAL(ZIP)<=ZIPHI)
SET TALK OFF
ENDIF
ENDIF
RELEASE ZIPHI,ZIPLO,INSTR,OS,WS,WA,ECNT,EP,FRST,NT
RELEASE OK,DELM,LC,LO,L,M,N,P,PLO,PLOC
RELEASE EC,EC1,EC2,EC3,EC4,EC5,EC6,EC7,EC8,EC9,EC10,EC11,EC12,EC13,EC14,EC15,EC16,EC17,EC18,EC19
RELEASE BE1,BE2,BE3,BE4,BE5,BE6,BE7,BE8,BE9,BE10,BE11,BE12,BE13,BE14,BE15,BE16,BE17,BE18,BE19
RELEASE EE1,EE2,EE3,EE4,EE5,EE6,EE7,EE8,EE9,EE10,EE11,EE12,EE13,EE14,EE15,EE16,EE17,EE18,EE19
USE
RETURN
E6,EE7,EE8,EE9,EE10,EE11,EE12,EE13,EE14,EE15,EE16,EE17,EE18,EE19
USE
RETURN